package com.sl.au.service;

import com.sl.au.entity.GridAreaInfo;
import com.sl.au.entity.Part;
import com.sl.au.entity.PartBaseInfo;
import com.sl.au.repository.PartBaseInfoRepository;

import java.util.List;

import org.springframework.data.domain.Sort.Direction;

public interface PartBaseInfoService extends BaseService {

	PartBaseInfoRepository getRepository();

	List<PartBaseInfo> getPage(int start, int length, String key, String orderName, Direction dir);

	int getCount(String key);

	List<PartBaseInfo> getPageByNoPart(int start, int length, String key, String orderName, Direction dir);

	int getCountByNoPart(String key);

	List<PartBaseInfo> getPageByPart(int start, int length, String partId, String key, String orderName, Direction dir);

	int getCountByPart(String partId, String key);

	List<PartBaseInfo> getPageByPartAndGrid(int start, int length, String partId, String gridId, String key,
			String orderName, Direction dir);

	int getCountByPartAndGrid(String partId, String gridId, String key);

	/****************** 部件权属部门相关查询 *******************/

	List<PartBaseInfo> getPageByNoHierarchy(int start, int length, String key, String orderName, Direction dir);

	int getCountByNoHierarchy(String key);

	List<PartBaseInfo> getPageByHierarchy(int start, int length, String hierarchyId, String key, String orderName,
			Direction dir);

	int getCountByHierarchy(String hierarchyId, String key);

	/****************** 部件管理部门相关查询 *******************/

	List<PartBaseInfo> getPageByNoManageHierarchy(int start, int length, String key, String orderName, Direction dir);

	int getCountByNoManageHierarchy(String key);

	List<PartBaseInfo> getPageByManageHierarchy(int start, int length, String hierarchyId, String key, String orderName,
			Direction dir);

	int getCountByManageHierarchy(String hierarchyId, String key);

	/****************** 部件维护部门相关查询 *******************/

	List<PartBaseInfo> getPageByNoMaintainHierarchy(int start, int length, String key, String orderName, Direction dir);

	int getCountByNoMaintainHierarchy(String key);

	List<PartBaseInfo> getPageByMaintainHierarchy(int start, int length, String hierarchyId, String key,
			String orderName, Direction dir);

	int getCountByMaintainHierarchy(String hierarchyId, String key);

	/********************************************************/

	PartBaseInfo getPartBaseInfoByName(String name);

	PartBaseInfo savePartBaseInfo(PartBaseInfo partBaseInfo);

	List<PartBaseInfo> getPageByGridAreaInfoAndKey(int start, int length, GridAreaInfo gridAreaInfo, String key,
			String orderName, Direction dir);

	int getCountByGridAreaInfoAndKey(GridAreaInfo gridAreaInfo, String key);

	List<PartBaseInfo> findBindPartOnlyCon(String con, String typeId, int start, int length);

	int findBindPartCountOnlyCon(String con, String typeId);

	List<PartBaseInfo> findBindPartNone(String typeId, int start, int length);

	int findBindPartCountNone(String typeId);

	List<PartBaseInfo> findBindPartByGridIdsAndCon(int start, int length, String[] gridIds, String con, String typeId);

	int findBindPartCountByGridIdsAndCon(String[] gridIds, String con, String typeId);

	List<PartBaseInfo> findBindPartByGridIds(String[] gridIds, int start, int length, String typeId);

	int findBindPartCountByGridIds(String[] gridIds, String typeId);

	List<PartBaseInfo> findBindPartByPartIdsAndCon(int start, int length, String[] partIds, String con, String typeId);

	int findBindPartCountByPartIdsAndCon(String[] partIds, String con, String typeId);

	List<PartBaseInfo> findBindPartByPartIds(String[] partIds, int start, int length, String typeId);

	int findBindPartCountByPartIds(String[] partIds, String typeId);

	List<PartBaseInfo> findUnbindPartOnlyCon(String con, String typeId, int start, int length);

	int findUnbindPartCountOnlyCon(String con, String typeId);

	List<PartBaseInfo> findUnbindPartNone(String typeId, int start, int length);

	int findUnbindPartCountNone(String typeId);

	List<PartBaseInfo> findUnbindPartByGridIdsAndCon(int start, int length, String[] gridIds, String con,
			String typeId);

	int findUnbindPartCountByGridIdsAndCon(String[] gridIds, String con, String typeId);

	List<PartBaseInfo> findUnbindPartByGridIds(String[] gridIds, int start, int length, String typeId);

	int findUnbindPartCountByGridIds(String[] gridIds, String typeId);

	List<PartBaseInfo> findUnbindPartByPartIdsAndCon(int start, int length, String[] partIds, String con,
			String typeId);

	int findUnbindPartCountByPartIdsAndCon(String[] partIds, String con, String typeId);

	List<PartBaseInfo> findUnbindPartByPartIds(String[] partIds, int start, int length, String typeId);

	int findUnbindPartCountByPartIds(String[] partIds, String typeId);

}
